{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "done\n"
     ]
    }
   ],
   "source": [
    "import gym\n",
    "import gym_ple\n",
    "import torch\n",
    "\n",
    "from gym.wrappers import Monitor\n",
    "import random\n",
    "\n",
    "env = gym.make('FlappyBird-v0')\n",
    "env = Monitor(env, directory='./results', force=True, video_callable=lambda ep: ep % 1 == 0)\n",
    "\n",
    "\n",
    "for i_eps in range(10):\n",
    "    env.reset()\n",
    "    while True:\n",
    "        a = 0\n",
    "        if(random.random()<0.5):\n",
    "            a = 1\n",
    "        s, _, done, _ = env.step(a)\n",
    "        if done:\n",
    "            break\n",
    "\n",
    "env.close()\n",
    "print('done')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
